package com.topscore.uke.mvp.presenters;

import com.topscore.uke.mvp.contractors.PostBodyDataContractor;
import com.topscore.uke.mvp.model.PostBodyDataModel;
import com.topscore.uke.network.request.PostBodyDataRequest;

/**
 * Created by 71468 on 2017/10/20.
 */

public class PostBodyDataPresenter implements PostBodyDataContractor, PostBodyDataContractor.Presenter {
    private View mView;
    private Model model;

    private PostBodyDataRequest mRequest;

    public PostBodyDataPresenter(View view) {
        this.mView = view;
       this.model = new PostBodyDataModel(new Listener() {
           @Override
           public void onPostSuccess() {

           }

           @Override
           public void onError(int errorCode, String errorMessage) {

           }

           @Override
           public void onComplete() {

           }
       });
    }

    @Override
    public void postBodyData() {
        mView.onLoading("正在提交");
        model.postData(mRequest);
    }

    public void setRequest(PostBodyDataRequest request) {
        this.mRequest = request;
    }
}
